
<template>
  <div class="gongyingshangshangpin">
    <div v-if="!shoujiban">
      <left></left>
      <div class="right">
        <div
          style="height: 91px; border-bottom: 1px solid rgb(227, 232, 241); width: 100%; padding: 0 30px;"
          class="flexbc"
        >
          <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }">订单管理</el-breadcrumb-item>
            <el-breadcrumb-item>我的订单</el-breadcrumb-item>
          </el-breadcrumb>
          <top></top>
        </div>
        <div style=" padding: 37px 30px 0 30px; height: calc(100vh - 91px); overflow: auto;">
          <div style="background: rgb(255, 255, 255); border-radius: 20px; padding: 20px;">
            <div class="flex">
              <div>
                <div style="margin-bottom: 10px;">订单来源</div>
                <div>
                  <el-input
                    v-model="search.source"
                    style="width: 200px; margin-right: 30px;"
                    placeholder="请输入"
                  ></el-input>
                </div>
              </div>
              <div>
                <div style="margin-bottom: 10px;">订单状态</div>
                <div class="flexc">
                  <div>
                    <el-select
                      clearable
                      filterable
                      style="width: 200px; margin-right: 30px;"
                      v-model="search.status"
                      placeholder="请选择"
                    >
                      <el-option
                        v-for="item in orderoptions"
                        :key="item.key"
                        :label="item.value"
                        :value="item.key"
                      ></el-option>
                    </el-select>
                  </div>
                </div>
              </div>
              <div>
                <div style="margin-bottom: 10px;">商品名称</div>
                <div>
                  <el-select
                    clearable
                    filterable
                    style="width: 240px; margin-right: 30px;"
                    v-model="search.goods_name"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in selleroptions"
                      :key="item.id"
                      :label="item.title"
                      :value="item.title"
                    ></el-option>
                  </el-select>
                </div>
              </div>
              <div>
                <div style="margin-bottom: 10px;">激活状态</div>
                <div>
                  <el-select
                    clearable
                    filterable
                    style="width: 200px; margin-right: 30px;"
                    v-model="search.active_status"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in activeoptions"
                      :key="item.key"
                      :label="item.value"
                      :value="item.key"
                    ></el-option>
                  </el-select>
                </div>
              </div>
              <div>
                <div style="margin-bottom: 10px;">交易状态</div>
                <div>
                  <el-select
                    clearable
                    filterable
                    style="width: 200px; margin-right: 30px;"
                    v-model="search.pay_status"
                    placeholder="请选择"
                  >
                    <el-option label="已支付" value="1"></el-option>
                    <el-option label="退款中" value="5"></el-option>
                    <el-option label="退款成功" value="6"></el-option>
                    <el-option label="无需支付" value="10"></el-option>
                  </el-select>
                </div>
              </div>
                           <div>
                <div style="margin-bottom: 10px;">是否秒返</div>
                <div>
                  <el-select
                    clearable
                    filterable
                    style="width: 200px; margin-right: 30px;"
                    v-model="search.quick_return"
                    placeholder="请选择"
                  >
                    <el-option label="普通" value="0"></el-option>
                    <el-option label="秒返" value="1"></el-option>
                  </el-select>
                </div>
              </div>
            </div>
            <div class="flex" style="margin-top: 30px;">
              <div>
                <div style="margin-bottom: 10px;">订单 ID</div>
                <div>
                  <el-input
                    v-model="search.order_no"
                    style="width: 200px; margin-right: 30px;"
                    placeholder="请输入"
                  >
                    <i
                      slot="suffix"
                      class="el-icon-circle-plus"
                      style="cursor: pointer;color: #005AFF;font-size:24px;margin-top: 8px;"
                      @click="addorder()"
                    ></i>
                  </el-input>
                </div>
              </div>
              <div>
                <div style="margin-bottom: 10px;">身份证号</div>
                <div class="flexc">
                  <div>
                    <el-input
                      v-model="search.id_card_num"
                      style="width: 300px; margin-right: 30px;"
                      placeholder="请输入"
                    ></el-input>
                  </div>
                </div>
              </div>
              <div>
                <div style="margin-bottom: 10px;">收件人电话</div>
                <div>
                  <el-input
                    v-model="search.address_mobile"
                    style="width: 200px; margin-right: 30px;"
                    placeholder="请输入"
                  ></el-input>
                </div>
              </div>
              <div>
                <div style="margin-bottom: 10px;">生产号码</div>
                <div>
                  <el-input
                    v-model="search.plan_mobile_produce"
                    style="width: 200px; margin-right: 30px;"
                    placeholder="请输入"
                  ></el-input>
                </div>
              </div>
              <div>
                <div style="margin: 10px 0">物流单号</div>
                <div>
                  <el-input
                    v-model="search.tracking_number"
                    style="width: 200px; margin-right: 30px;"
                    placeholder="请输入"
                    clearable
                  ></el-input>
                </div>
              </div>
              <div>
                <div style="margin: 10px 10px">下单时间</div>
                <el-date-picker
                  style="width: 380px; "
                  v-model="times"
                  @change="timechange"
                  :picker-options="pickerOptions"
                  :clearable="true"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  type="datetimerange"
                  :default-time="['00:00:00', '23:59:59']"
                  range-separator="-"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                ></el-date-picker>
              </div>
              <div>
                <div style="margin: 10px 0">激活时间</div>
                <el-date-picker
                  style="width: 380px;margin-left: 10px "
                  v-model="times2"
                  @change="timechange2"
                  :picker-options="pickerOptions"
                  :clearable="true"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  type="datetimerange"
                  :default-time="['00:00:00', '23:59:59']"
                  range-separator="-"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                ></el-date-picker>
              </div>
            </div>

            <!-- <div class="flex" style="margin-top: 20px;align-items: center;">
              <el-date-picker
                class="t_del_com"
                v-model="search.start_time"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetime"
                placeholder="选择日期时间">
              </el-date-picker>
              <span style="margin-left: 10px;margin-right: 10px;color: #AFB3BC;">-</span>
              <el-date-picker
                class="t_del_com"
                v-model="search.end_time"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetime"
                placeholder="选择日期时间">
              </el-date-picker>
            </div>-->
            <div class="flexbc" style="margin-top: 20px;">
              <div class="flex">
                <div style="margin-right: 20px;">
                  <div>
                    <el-button type="primary" round @click="searchbtn">搜索</el-button>
                  </div>
                </div>
                <div style="margin-right: 20px;">
                  <div>
                    <el-button round @click="resetbtn">重置</el-button>
                  </div>
                </div>
                <div style="margin-right: 20px;" class="flexc">
                  <el-button
                    type="primary"
                    round
                    @click="$router.push('/dingdanguanli/dingdanchuli/dingdandaoru')"
                  >导入订单</el-button>
                </div>
                <div style="margin-right: 20px;">
                  <div>
                    <el-button type="primary" plain round @click="daochu">导出订单</el-button>
                  </div>
                </div>
              </div>
              <div class="flexc">
                <div>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="开启后未付款订单会自动提单到敢探号生产"
                    placement="top-start"
                  >
                    <i
                      class="el-icon-question"
                      style="font-size: 20px; color: rgba(0, 0, 0, 0.65);"
                    ></i>
                  </el-tooltip>
                </div>
                <div style="margin:0 10px; color: rgb(64, 66, 71);">待支付订单流转</div>
                <div>
                  <el-switch
                    v-model="auto_circulation"
                    @change="zidongliuzhuan()"
                    style="width: 85px; height: 41px;"
                    active-color="rgb(0, 90, 255);"
                    inactive-color="rgb(246, 248, 251);"
                    :active-value="1"
                    :inactive-value="0"
                  ></el-switch>
                </div>


                <div style="margin-left: 30px;">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="开启后用户退款成功会自动在敢探号放弃订单"
                    placement="top-start"
                  >
                    <i
                      class="el-icon-question"
                      style="font-size: 20px; color: rgba(0, 0, 0, 0.65);"
                    ></i>
                  </el-tooltip>
                </div>
                <div style="margin:0 10px; color: rgb(64, 66, 71);">退款订单放弃</div>
                <div>
                  <el-switch
                    v-model="auto_order_cancel"
                    @change="zidongliuzhuan2()"
                    style="width: 85px; height: 41px;"
                    active-color="rgb(0, 90, 255);"
                    inactive-color="rgb(246, 248, 251);"
                    :active-value="10"
                    :inactive-value="0"
                  ></el-switch>
                </div>
              </div>
            </div>
          </div>

          <div>
            <!-- 列表 -->
            <!-- tab -->
            <div class="t_list_tab_box">
              <div class="t_choose_tab_box">
                <div
                  @click="choosetabbtn(1)"
                  :class="{t_tab_title_lei:nowtab==1}"
                  class="t_tab_title"
                >
                  全部订单
                  <div class="t_under_line" :class="{t_under_line_lei:nowtab==1}"></div>
                </div>

                <div
                  @click="choosetabbtn(2)"
                  :class="{t_tab_title_lei:nowtab==2}"
                  class="t_tab_title"
                  style="margin-left: 40px;margin-right: 40px; position: relative;"
                >
                  证件不合格
                  <div
                    style=" position: absolute; right: -40px; top: 1px; border-radius: 10px; background: #f00; color: #fff;  font-size: 12px; padding: 2px 10px;"
                    class="flexcc"
                  >{{card_num}}</div>
                  <div class="t_under_line" :class="{t_under_line_lei:nowtab==2}"></div>
                </div>

                <div
                  @click="choosetabbtn(3)"
                  :class="{t_tab_title_lei:nowtab==3}"
                  class="t_tab_title"
                  style="margin-left: 40px;margin-right: 70px;position: relative;"
                >
                  开卡失败
                  <div
                    style=" position: absolute; right: -50px; top: 1px; border-radius: 10px; background: #f00; color: #fff;  font-size: 12px; padding: 2px 10px;"
                    class="flexcc"
                  >{{fail_num}}</div>
                  <div class="t_under_line" :class="{t_under_line_lei:nowtab==3}"></div>
                </div>
                <div
                  @click="choosetabbtn(4)"
                  :class="{t_tab_title_lei:nowtab==4}"
                  class="t_tab_title"
                  style="position: relative;"
                >
                  退款中
                  <div
                    style=" position: absolute; right: -40px; top: 1px; border-radius: 10px; background: #f00; color: #fff;  font-size: 12px; padding: 2px 10px;"
                    class="flexcc"
                  >{{refund_num}}</div>
                  <div class="t_under_line" :class="{t_under_line_lei:nowtab==4}"></div>
                </div>
              </div>
              <el-pagination
                :page-size="search.page_size"
                @current-change="pagechange"
                style="margin-bottom: 10px;"
                background
                layout="prev,pager,next,total,jumper"
                :total="total"
              ></el-pagination>
            </div>
            <!-- 表头 -->
            <div class="t_table_header_box">
              <div class="t_tab_w1">订单信息</div>
              <div class="t_tab_w2">
                时间排序
                <i
                  class="el-icon-sort"
                  @click="changesort"
                  style="margin-left: 10px;cursor: pointer;"
                ></i>
              </div>
              <div class="t_tab_w3">收件人管理</div>
              <div class="t_tab_w4">失败原因</div>
              <div class="t_tab_w5">订单状态</div>
              <div class="t_tab_w6">生产信息</div>
              <div class="t_tab_w6">备注</div>
              <div class="t_tab_w7">操作</div>
            </div>
            <!-- 列表 -->
            <div class="t_table_list_con" v-for="(item,index) in list" :key="index">
              <div class="t_table_list_top">
                <div>
                  订单ID: {{ item.order_no }}
                  <i
                    class="el-icon-document-copy"
                    @click="copy(item.order_no)"
                    style="margin-left: 10px;cursor: pointer;"
                  ></i>
                </div>
                <!-- 如果上游订单号显示是0 -->
                <div v-if="item.upstream_order_id.toString()=='0'" style="margin-left: 60px;">上游订单号:</div>
                <!-- 如果上游订单号显示不是0 -->
                <div v-if="item.upstream_order_id.toString()!=='0'" style="margin-left: 60px;">
                  上游订单号: {{ item.upstream_order_id.toString() }}
                  <i
                    class="el-icon-document-copy"
                    @click="copy(item.upstream_order_id.toString())"
                    style="margin-left: 10px;cursor: pointer;"
                  ></i>
                </div>
                <div style="margin-left: 60px;margin-right: 60px;">订单来源：{{ item.source }}</div>
                <div>平台创建时间：{{ item.created_at }}</div>
              </div>
              <div class="t_table_list_con_con">
                <div style="width: 25%;">
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">商品名称：</span>
                    {{ item.goods_name }}
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">商品编码：</span>
                    {{ item.goods_sku }}
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">供应商：</span>

                    <span v-if="expandcollapse.includes(index)">{{ item.supplier_name }}</span>
                    <el-button
                      v-if="!expandcollapse.includes(index)"
                      @click="chaxun(item,index)"
                      style="margin-left: 10px;"
                      type="text"
                    >查询</el-button>
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">购买号码：</span>
                    {{ item.plan_mobile }}
                  </div>
                </div>

                <div class="t_tab_w3">
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">证件姓名：</span>
                    {{ item.id_card_name }}
                    <span
                      class="t_table_list_con_title"
                      style="margin-left: 20px;"
                    >收件人：</span>
                    {{ item.address_name }}
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">证件号码：</span>
                    {{ item.id_card_num }}
                    <el-button @click="checkimg(item)" style="margin-left: 10px;" type="text">查看证件</el-button>
                    <el-button @click="jiemi(item,1)" type="text">查看完整信息</el-button>
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">联系电话：</span>
                    {{ item.address_mobile }}
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">收货地址：</span>
                    {{ item.address_province }}{{ item.address_city }}{{ item.address_district }}{{ item.address }}
                  </div>
                </div>
                <div
                  class="t_tab_w4"
                  style="box-sizing: border-box;padding-right: 20px;"
                >{{ item.reason }}</div>
                <div class="t_tab_w5">
                  <div class="flexbc">
                    <div class="t_item_info">{{ item.status_name }}</div>
                    <div
                      class="t_item_info"
                      style="padding-right: 20px; color: #409EFF; cursor: pointer;"
                      @click="caozuojilu(item)"
                    >操作记录</div>
                  </div>

                  <div class="t_item_info">
                    <span class="t_table_list_con_title">交易状态：</span>
                    {{ item.pay_name }}

                    <el-tooltip
                      class="item"
                      effect="dark"
                      :content="item.refuse_remarks"
                      placement="top-start" v-if="item.refuse_remarks"
                    >
                      <i
                        class="el-icon-question"
                        style="font-size: 20px; color: rgba(0, 0, 0, 0.65);"
                      ></i>
                    </el-tooltip>
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">激活状态：</span>
                    {{ item.active_name }}
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">实收款：</span>
                    ￥{{ item.actual_payment}}
                  </div>
                  <div class="t_item_info" v-if="item.active_name=='激活且充值'">
                    <span class="t_table_list_con_title">金额：</span>
                    {{ item.recharge_amount }}
                  </div>
                </div>
                <div class="t_tab_w6">
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">生产号码：</span>
                    {{ item.plan_mobile_produce }}
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">物流公司：</span>
                    <span
                      style="color: #409EFF;"
                      @click="wuliu(item)"
                    >{{ item.tracking_company_id }}</span>
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">物流单号：</span>
                    {{ item.tracking_number }}
                  </div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">iccid：</span>
                    {{ item.iccid }}
                  </div>
                </div>
                <div class="t_tab_w6" style="max-height: 130px; overflow: auto;">
                  <div v-html="item.remarks"></div>
                  <!-- <div class="t_item_info" style="width: 150px; height: 32px; overflow: hidden; text-overflow: ellipsis;  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">{{item.remarks}}</div> -->
                </div>
                <div class="t_tab_w7" style="display: flex;flex-direction: column;">
                  <div v-if="nowtab==4">
                    <div>
                      <el-button
                        v-if="item.pay_status==5&&!item.isclicktui"
                        style="margin-bottom: 20px;margin-top: 2px;"
                        type="text"
                        @click="agreetui(item,index)"
                      >同意退款</el-button>
                    </div>
                    <div>
                      <el-button
                        v-if="item.pay_status==5&&!item.isclicktui"
                        style="margin-bottom: 20px;margin-top: 2px;"
                        type="text"
                        @click="agreetui2(item,index)"
                      >拒绝退款</el-button>
                    </div>

                    <el-button
                      v-if="item.isclicktui==1"
                      style="margin-bottom: 20px;margin-top: 2px;color: black; margin-left: 0;"
                      type="text"
                    >已退款</el-button>
                    <el-button
                      v-if="item.isclicktui==3"
                      style="margin-bottom: 20px;margin-top: 2px;color: black; margin-left: 0;"
                      type="text"
                    >已拒绝退款</el-button>
                  </div>
                  <div v-else>
                    <el-button
                      style="margin-bottom: 20px;margin-top: 2px;"
                      type="text"
                      @click="editorderbtn(item)"
                    >修改订单</el-button>
                    <el-button
                      v-if="item.status==150||item.status==-460"
                      @click="giveup(item.order_id)"
                      style="margin-left: 0;margin-bottom: 20px;"
                      class="t_button_style"
                      type="text"
                    >放弃订单</el-button>
                    <el-dropdown @command="handleCommand($event,item)" trigger="click">
                      <span class="el-dropdown-link">
                        更多
                        <i class="el-icon-arrow-down el-icon--right"></i>
                      </span>
                      <el-dropdown-menu slot="dropdown">
                        <!-- <el-dropdown-item command="a">修改商品</el-dropdown-item> -->
                        <el-dropdown-item command="b">修改照片</el-dropdown-item>
                        <el-dropdown-item command="c">重提订单</el-dropdown-item>
                        <el-dropdown-item command="d">编辑备注</el-dropdown-item>
                        <el-dropdown-item command="e">退款</el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <!-- <footers></footers> -->
        </div>
      </div>
    </div>

    <!-- 修改商品 -->
    <el-dialog
      title="修改商品"
      :visible.sync="isshoweditseller"
      :close-on-click-modal="false"
      width="440px"
    >
      <div style="margin-bottom: 20px;">
        <div class="t_change_seller_title">通过商品名称修改</div>
        <el-select
          style="width: 100%;"
          @change="checkchengname"
          :disabled="disablename"
          clearable
          v-model="goods_name"
          filterable
          placeholder="请选择"
        >
          <el-option
            v-for="item in selleroptions"
            :key="item.id"
            :label="item.title"
            :value="item.id"
          ></el-option>
        </el-select>
      </div>
      <div style="margin-bottom: 20px;">
        <div class="t_change_seller_title">通过商品编码修改</div>
        <el-input
          @blur="checkskures"
          @input="checkchengsku"
          :disabled="disablesku"
          v-model="goods_sku"
          placeholder="请输入内容"
        ></el-input>
      </div>
      <div style="margin-bottom: 30px;">
        <div class="t_change_seller_title">查询结果</div>
        <el-input
          :disabled="true"
          resize="none"
          type="textarea"
          rows="5"
          v-model="skucheckres"
          placeholder
        ></el-input>
      </div>
      <div style="text-align: right;">
        <el-button round @click="isshoweditseller = false">取 消</el-button>
        <el-button round type="primary" @click="upeditseller">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 修改订单 -->
    <el-dialog
      title="修改订单信息"
      :visible.sync="isshoweditorder"
      width="560px"
      :close-on-click-modal="false"
    >
      <div>
        <div style="display: flex;" v-if="!shoujiban">
          <div style="margin-bottom: 20px;">
            <div class="t_change_seller_title">收货人</div>
            <el-input
              style="width: 250px;"
              v-model="changeorderinfo.address_name"
              placeholder="请输入收货人名称"
            ></el-input>
          </div>
          <div style="margin-bottom: 20px;margin-left: 20px;">
            <div class="t_change_seller_title">身份证姓名</div>
            <el-input
              style="width: 250px;"
              v-model="changeorderinfo.id_card_name"
              placeholder="请输入身份证姓名"
            ></el-input>
          </div>
        </div>
        <div v-if="shoujiban">
          <div style="margin-bottom: 20px;">
            <div class="t_change_seller_title">收货人</div>
            <el-input
              style="width: 250px;"
              v-model="changeorderinfo.address_name"
              placeholder="请输入收货人名称"
            ></el-input>
          </div>
          <div style="margin-bottom: 20px;">
            <div class="t_change_seller_title">身份证姓名</div>
            <el-input
              style="width: 250px;"
              v-model="changeorderinfo.id_card_name"
              placeholder="请输入身份证姓名"
            ></el-input>
          </div>
        </div>
        <div style="margin-bottom: 20px;">
          <div class="t_change_seller_title">身份证号</div>
          <el-input v-model="changeorderinfo.id_card_num" placeholder="请输入身份证号"></el-input>
        </div>
        <div style="margin-bottom: 20px;">
          <div class="t_change_seller_title">联系电话</div>
          <el-input
            style="width: 250px;"
            v-model="changeorderinfo.address_mobile"
            placeholder="请输入联系电话"
          ></el-input>
        </div>
        <div style="margin-bottom: 20px;">
          <div class="t_change_seller_title" style="display: flex; justify-content: space-between;">
            <div>收货地址</div>
            <div @click="showzdy" style="font-size:12px;color:#AFB3BC;cursor: pointer;">没有找到省市区？手动填写</div>
          </div>
          <el-cascader
            style="width: 100%;margin-bottom: 10px;"
            @change="changeaddress"
            v-model="localcitycode"
            :options="options"
          ></el-cascader>
          <div v-if="isshowzdyshq" style="display: flex;margin-bottom: 10px;">
            <el-input @input="inputaddress" v-model="province_z" placeholder="省"></el-input>
            <el-input
              @input="inputaddress"
              style="margin-left: 10px;margin-right: 10px;"
              v-model="city_z"
              placeholder="市"
            ></el-input>
            <el-input @input="inputaddress" v-model="district_z" placeholder="区"></el-input>
          </div>
          <el-input v-model="changeorderinfo.address" placeholder="请输入收货地址"></el-input>
        </div>
      </div>
      <div style="text-align: right;margin-top: 90px;">
        <el-button round @click="upeditorder(0)">仅保存</el-button>
        <el-button round type="primary" @click="upeditorder(1)">保存并提交至初审</el-button>
      </div>
    </el-dialog>
    <!-- 修改照片 -->
    <el-dialog
      title="身份证照片"
      :center="true"
      :visible.sync="isshoweditimg"
      :close-on-click-modal="false"
      width="1240px"
    >
      <div>
        <div class="t_photo_top">
          <div v-if="checkimgtype==1" style="font-size: 18px;">查看照片</div>
          <div v-if="checkimgtype==2" style="font-size: 18px;">修改照片</div>
          <!-- <el-button type="text">复制订单专属照片上传链接</el-button> -->
        </div>
        <div v-if="checkimgtype==2 && !shoujiban" class="t_img_list_box">
          <div class="t_img_item">
            <chuantu2
              :widths="'280px'"
              :heights="'230px'"
              :bg="'#F6F8FB'"
              :imgs="card_img_1"
              @getimg="getimg1"
              :bgimg="1"
              v-if="relo"
            ></chuantu2>
            <div class="t_img_tips">补充正面照片</div>
          </div>
          <div class="t_img_item">
            <chuantu2
              :widths="'280px'"
              :heights="'230px'"
              :bg="'#F6F8FB'"
              :imgs="card_img_2"
              @getimg="getimg2"
              :bgimg="2"
              v-if="relo"
            ></chuantu2>
            <div class="t_img_tips">补充反面照片</div>
          </div>
          <div class="t_img_item">
            <chuantu2
              :widths="'280px'"
              :heights="'230px'"
              :bg="'#F6F8FB'"
              :imgs="card_img_3"
              @getimg="getimg3"
              :bgimg="3"
              v-if="relo"
            ></chuantu2>
            <div class="t_img_tips">补充免冠照片</div>
          </div>
          <div class="t_img_item">
            <chuantu2
              :widths="'280px'"
              :heights="'230px'"
              :bg="'#F6F8FB'"
              :imgs="checkimgitem.custom_photos_url"
              @getimg="getimg4"
              :bgimg="3"
              v-if="relo"
            ></chuantu2>
            <div class="t_img_tips">{{checkimgitem.custom_photo_description}}上传</div>
          </div>
        </div>
        <div v-if="checkimgtype==2 && shoujiban" style="margin-top: 0.2rem;">
          <div class="t_img_item" style="margin-bottom: 0.2rem;">
            <chuantu2
              :widths="'100%'"
              :heights="'230px'"
              :bg="'#F6F8FB'"
              :imgs="card_img_1"
              @getimg="getimg1"
              :bgimg="1"
              v-if="relo"
            ></chuantu2>
            <div class="t_img_tips">补充正面照片</div>
          </div>
          <div class="t_img_item" style="margin-bottom: 0.2rem;">
            <chuantu2
              :widths="'100%'"
              :heights="'230px'"
              :bg="'#F6F8FB'"
              :imgs="card_img_2"
              @getimg="getimg2"
              :bgimg="2"
              v-if="relo"
            ></chuantu2>
            <div class="t_img_tips">补充反面照片</div>
          </div>
          <div class="t_img_item" style="margin-bottom: 0.2rem;">
            <chuantu2
              :widths="'100%'"
              :heights="'230px'"
              :bg="'#F6F8FB'"
              :imgs="checkimgitem.custom_photos_url"
              @getimg="getimg4"
              :bgimg="3"
              v-if="relo"
            ></chuantu2>
            <div class="t_img_tips">{{checkimgitem.custom_photo_description}}上传</div>
          </div>
        </div>
        <div v-if="checkimgtype==1 && !shoujiban" class="t_img_list_box">
          <div class="t_img_item">
            <img v-if="card_img_1" class="t_check_old_img" :src="card_img_1" alt />
            <img v-else class="t_check_old_img" src="@/../static/img/face1.png" alt />
            <div class="t_img_tips">补充正面照片</div>
          </div>
          <div class="t_img_item">
            <img v-if="card_img_2" class="t_check_old_img" :src="card_img_2" alt />
            <img v-else class="t_check_old_img" src="@/../static/img/face2.png" alt />
            <div class="t_img_tips">补充反面照片</div>
          </div>
          <div class="t_img_item">
            <img v-if="card_img_3" class="t_check_old_img" :src="card_img_3" alt />
            <img v-else class="t_check_old_img" src="@/../static/img/face3.png" alt />
            <div class="t_img_tips">补充免冠照片</div>
          </div>
          <div class="t_img_item" v-if="checkimgitem.custom_photos_url">
            <img v-if="checkimgitem.custom_photos_url" class="t_check_old_img" :src="checkimgitem.custom_photos_url" alt />
            <img v-else class="t_check_old_img" src="@/../static/img/face3.png" alt />
            <div class="t_img_tips">{{checkimgitem.custom_photo_description}}上传</div>
          </div>
        </div>
        <div v-if="checkimgtype==1 && shoujiban">
          <div class="t_img_item" style="margin-bottom: 0.2rem;">
            <img v-if="card_img_1" class="t_check_old_img" :src="card_img_1" alt />
            <img v-else class="t_check_old_img" src="@/../static/img/face1.png" alt />
            <div class="t_img_tips">补充正面照片</div>
          </div>
          <div class="t_img_item" style="margin-bottom: 0.2rem;">
            <img v-if="card_img_2" class="t_check_old_img" :src="card_img_2" alt />
            <img v-else class="t_check_old_img" src="@/../static/img/face2.png" alt />
            <div class="t_img_tips">补充反面照片</div>
          </div>
          <div class="t_img_item" style="margin-bottom: 0.2rem;">
            <img v-if="card_img_3" class="t_check_old_img" :src="card_img_3" alt />
            <img v-else class="t_check_old_img" src="@/../static/img/face3.png" alt />
            <div class="t_img_tips">补充免冠照片</div>
          </div>
          <div class="t_img_item" v-if="checkimgitem.custom_photos_url">
            <img v-if="checkimgitem.custom_photos_url" class="t_check_old_img" :src="checkimgitem.custom_photos_url" alt />
            <img v-else class="t_check_old_img" src="@/../static/img/face3.png" alt />
            <div class="t_img_tips">{{checkimgitem.custom_photo_description}}上传</div>
          </div>
        </div>
      </div>

      <div v-if="checkimgtype==2" style="text-align: center;margin-top: 50px;">
        <el-button round type="primary" @click="upediteimg">保存</el-button>

        <el-button round type="primary" @click="upediteimg(1)">保存并提交至初审</el-button>
      </div>
    </el-dialog>
    <el-dialog
      center
      title="物流详情"
      :visible.sync="wuliuxiangqinglog"
      width="600px"
      :close-on-click-modal="false"
    >
      <div v-if="wuliuxiangqingall.Traces">
        <el-timeline>
          <el-timeline-item
            v-for="(activity, index) in wuliuxiangqingall.Traces"
            :key="index"
            :timestamp="activity.AcceptTime"
          >{{activity.AcceptStation}}</el-timeline-item>
        </el-timeline>
      </div>
      <div v-if="wuliuxiangqingall.Reason">{{wuliuxiangqingall.Reason}}</div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" round @click="wuliuxiangqinglog = false">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="备注" :visible.sync="beizhulog" width="600px" :close-on-click-modal="false">
      <div>
        <fuwenben :content="now.remarks" @getcontent="getcontent" v-if="relo"></fuwenben>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" round @click="baocunbeizhu">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 手机版 -->
    <div v-if="shoujiban" style=" color: rgb(2, 12, 29); font-size: 0.24rem; background: #f6f8fb;">
      <div class="tabs_container">
        <div @click="choosetab('one')" :class="activeName === 'one' ? 'wares' : 'initial'">我的订单</div>
        <div
          @click="choosetab('two')"
          :class="activeName === 'two' ? 'wares' : 'initial'"
          style="margin-left:30px"
        >分销商订单</div>
        <div
          style="display:flex;align-items:center;color:#005AFF;position:absolute;right:20px;top:25px"
          @click="settingClick"
          v-show="activeName === 'one'"
        >
          <img
            src="../../../static/appimg/setting.png"
            alt
            style="width:16px;height:16px;margin-right:2px"
          />
          设置
        </div>
      </div>
      <div class="search_container" v-show="activeName === 'one'">
        <div style="display:flex;padding: 16px 0 0 20px;align-items: center;">
          <div class="search_input_container">
            <el-input
              v-model="search.all_round"
              placeholder="订单来源/ID/商品/身份证/电话/生产号码/物流单号"
              class="search_input"
            ></el-input>
            <div class="search_color" @click="searchbtn">搜索</div>
          </div>
        </div>
        <div class="tabs_footer_container">
          <div class="order_container" @click="orderStatuClick">
            订单状态
            <img
              src="../../../static/appimg/arrowtwo.png"
              alt
              style="width:5px;height:4px;margin:2px 0 0 4px"
            />
          </div>
          <div class="order_container" @click="activeStatuClick">
            激活状态
            <img
              src="../../../static/appimg/arrowtwo.png"
              alt
              style="width:5px;height:4px;margin:2px 0 0 4px"
            />
          </div>
          <div class="order_container" @click="c8show = true">
            {{ c8name }}
            <img
              src="../../../static/appimg/arrowtwo.png"
              alt
              style="width:5px;height:4px;margin:2px 0 0 4px"
            />
          </div>
          <div class="order_container" @click="timeClick">
            时间筛选
            <img
              src="../../../static/appimg/funnel.png"
              alt
              style="width:8px;height:7px;margin-left:4px"
            />
          </div>
        </div>
      </div>
      <div style="padding:0 0.3rem;" v-if="activeName === 'one'">
        <!-- <div style=" background: #fff; padding: 0.2rem; border-radius: 0.2rem;">
          <div>
            <el-input
              v-model="search.source"
              style="width: 100%; margin-bottom: 0.2rem;"
              placeholder="请输入订单来源"
            ></el-input>
          </div>
          <div>
            <el-select
              clearable
              filterable
              style="width: 100%; margin-bottom: 0.2rem;"
              v-model="search.status"
              placeholder="请选择订单状态"
            >
              <el-option
                v-for="item in orderoptions"
                :key="item.key"
                :label="item.value"
                :value="item.key"
              ></el-option>
            </el-select>
          </div>
          <div>
            <el-select
              clearable
              filterable
              style="width: 100%; margin-bottom: 0.2rem;"
              v-model="search.goods_name"
              placeholder="请选择商品"
            >
              <el-option
                v-for="item in selleroptions"
                :key="item.id"
                :label="item.title"
                :value="item.title"
              ></el-option>
            </el-select>
          </div>
          <div>
            <el-select
              clearable
              filterable
              style="width: 100%; margin-bottom: 0.2rem;"
              v-model="search.active_status"
              placeholder="请选择激活状态"
            >
              <el-option
                v-for="item in activeoptions"
                :key="item.key"
                :label="item.value"
                :value="item.key"
              ></el-option>
            </el-select>
          </div>
          <div>
            <el-select
              clearable
              filterable
              style="width: 100%; margin-bottom: 0.2rem;"
              v-model="search.pay_status"
              placeholder="请选择"
            >
              <el-option label="已支付" value="1"></el-option>
              <el-option label="退款中" value="5"></el-option>
              <el-option label="退款成功" value="6"></el-option>
              <el-option label="无需支付" value="10"></el-option>
            </el-select>
          </div>

          <div>
            <el-input
              v-model="search.order_no"
              style="width: 100%; margin-bottom: 0.2rem;"
              placeholder="请输入订单 ID"
            ></el-input>
          </div>
          <div>
            <el-input
              v-model="search.id_card_num"
              style="width: 100%; margin-bottom: 0.2rem;"
              placeholder="请输入身份证号"
            ></el-input>
          </div>
          <div>
            <el-input
              v-model="search.address_mobile"
              style="width: 100%; margin-bottom: 0.2rem;"
              placeholder="请输入收件人电话"
            ></el-input>
          </div>
          <div>
            <el-input
              v-model="search.plan_mobile_produce"
              style="width: 100%; margin-bottom: 0.2rem;"
              placeholder="请输入生产号码"
            ></el-input>
          </div>
          <div>
            <el-input
              v-model="search.tracking_number"
              style="width: 100%; margin-bottom: 0.2rem;"
              placeholder="请输入物流单号"
            ></el-input>
          </div>

          <div class="flexbc">
            <div
              class="datashow"
              @click="xuanshijianshow(1)"
              style="color: #C0C4CC;"
              v-if="!search.start_time"
            >请选择开始日期</div>
            <div
              class="datashow"
              @click="xuanshijianshow(1)"
              v-if="search.start_time"
            >{{search.start_time}}</div>
            <div>~</div>
            <div
              class="datashow"
              @click="xuanshijianshow(2)"
              style="color: #C0C4CC;"
              v-if="!search.end_time"
            >请选择结束日期</div>
            <div
              class="datashow"
              @click="xuanshijianshow(2)"
              v-if="search.end_time"
            >{{search.end_time}}</div>
          </div>
          <van-popup v-model="showdate" round position="bottom">
            <van-datetime-picker
              type="date"
              :min-date="minDate"
              title="选择时间"
              @confirm="xuanshijian"
              @cancel="showdate = false"
            />
          </van-popup>


          <div class="flexbc" style="margin-top: 0.2rem;">
            <div style="margin-right: 0.2rem;">
              <div>
                <el-button type="primary" style="width: 4.6rem;" round @click="searchbtn">搜索</el-button>
              </div>
            </div>
            <div>
              <div>
                <el-button round @click="resetbtn">重置</el-button>
              </div>
            </div>
          </div>
        </div>-->
        <div style=" padding: 0.1rem; margin-top: 0.35rem;">
          <div class="flex">
            <div
              @click="choosetabbtn(1)"
              style="flex: 1;font-size:15px"
              class="t_tab_title"
              :class="{t_tab_title_lei:nowtab==1}"
            >
              全部订单
              <div class="t_under_line_app" :class="{t_under_line_lei:nowtab==1}"></div>
            </div>
            <div
              @click="choosetabbtn(2)"
              style="flex: 1;font-size:15px"
              class="t_tab_title"
              :class="{t_tab_title_lei:nowtab==2}"
            >
              证件不合格
              <div class="t_under_line_app" :class="{t_under_line_lei:nowtab==2}"></div>
            </div>
            <div
              @click="choosetabbtn(3)"
              style="flex: 1;font-size:15px"
              class="t_tab_title"
              :class="{t_tab_title_lei:nowtab==3}"
            >
              开卡失败
              <div class="t_under_line_app" :class="{t_under_line_lei:nowtab==3}"></div>
            </div>
            <div
              @click="choosetabbtn(4)"
              style="flex: 1;font-size:15px"
              class="t_tab_title"
              :class="{t_tab_title_lei:nowtab==4}"
            >
              退款中
              <div class="t_under_line_app" :class="{t_under_line_lei:nowtab==4}"></div>
            </div>
          </div>
        </div>
        <!-- 订单 -->
        <div style="margin-top: 0.1rem;">
          <van-list
            v-model="loading"
            :finished="finished"
            finished-text="没有更多了"
            @load="onLoad"
            style="min-height: 3rem;"
          >
            <div v-for="(item,index) in list" :key="item.id">
              <div
                style="background: #fff; padding: 0.2rem; border-radius: 0.2rem;  margin-bottom: 0.2rem;"
              >
                <div
                  style="padding-right:8px;display:flex;align-items:center;margin-bottom: 0.2rem;background:#EDF7FF;height:36px;border-radius:8px;line-height:36px;padding-left:8px;justify-content:space-between;"
                >
                  <div>
                    <span style="color:#005AFF;font-size:14px">订单ID：</span>
                    <span style="color:#005AFF;font-size:14px">{{ item.order_no }}</span>
                    <i
                      class="el-icon-document-copy"
                      @click="copy(item.order_no)"
                      style="margin-left: 3px;cursor: pointer;color:#005AFF"
                    ></i>
                  </div>
                  <img
                    @click="bianjixiangqing(item)"
                    src="../../../static/appimg/rightblue.png"
                    alt
                    style="width:4px;height:8px"
                  />
                </div>
                <!-- <div v-if="item.upstream_order_id.toString()!=='0'" style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">上游订单号：</span>
                  {{ item.upstream_order_id.toString() }}
                  <i
                    class="el-icon-document-copy"
                    @click="copy(item.upstream_order_id.toString())"
                    style="margin-left: 10px;cursor: pointer;"
                  ></i>
                </div>-->
                <div style="font-size:14px;color:#AFB3BC">
                  <span>收件人:</span>
                  <span
                    style="color:#020C1D;font-size:16px;font-weight:bold;margin-left:20px"
                  >{{item.address_name}}</span>
                  <span
                    style="color:#020C1D;font: size 14px;px;margin-left:10px"
                  >{{item.address_mobile}}</span>
                  <span
                    style="color:#020C1D;font-size:14px;color:#AFB3BC;float:right"
                  >{{item.status_name}}</span>
                </div>
                <div style=" margin-top: 0.2rem;">
                  <span style="font-size:14px;color:#AFB3BC">生产号码：</span>
                  <span
                    style="color:#020C1D;font-size:14px;margin-left:15px"
                  >{{ item.plan_mobile_produce }}</span>
                  <span
                    style="color:#020C1D;font-size:14px;color:#AFB3BC;float:right"
                  >{{ item.active_name}}</span>
                </div>
                <div style=" margin-top: 0.2rem;">
                  <span style="font-size:14px;color:#AFB3BC">商品名称：</span>
                  <span style="color:#020C1D;font-size:14px;">{{ item.goods_name }}</span>
                </div>
                <div style=" margin-top: 0.2rem;">
                  <span style="font-size:14px;color:#AFB3BC">订单来源：</span>
                  <span style="color:#020C1D;font-size:14px;">{{ item.source }}</span>
                </div>
                <div style=" margin-top: 0.2rem;">
                  <span style="font-size:14px;color:#AFB3BC">证件号码：</span>
                  <span style="color:#020C1D;font-size:14px;">{{ item.id_card_num }}</span>
                </div>
                <div style=" margin-top: 0.2rem;">
                  <span style="font-size:14px;color:#AFB3BC">物流单号：</span>
                  <span style="color:#020C1D;font-size:14px;">{{ item.tracking_number }}</span>
                </div>
                <div style=" margin-top: 0.2rem;">
                  <span style="font-size:14px;color:#AFB3BC">iccid：</span>
                  <span style="color:#020C1D;font-size:14px;">{{ item.iccid }}</span>
                </div>
                <div style=" margin-top: 0.2rem;">
                  <span style="font-size:14px;color:#AFB3BC">收货地址：</span>
                  <span
                    style="color:#020C1D;font-size:14px;"
                  >{{ item.address_province }}{{ item.address_city }}{{ item.address_district }}{{ item.address }}</span>
                </div>
                <div style=" margin-top: 0.2rem;display:flex;justify-content:space-between;">
                  <div>
                    <span style="font-size:14px;color:#AFB3BC">实收款：</span>
                    <span style="color:#FD5200;font-size:14px;">￥{{ item.actual_payment }}</span>
                  </div>
                  <div style="font-size: 14px;color:rgb(175, 179, 188)">{{item.pay_name}}
                    {{item.refuse_remarks}}
                  </div>
                </div>
                <!-- <div v-if="item.upstream_order_id.toString()=='0'" style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">上游订单号：</span>
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">订单来源：</span>
                  {{ item.source }}
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">平台创建时间：</span>
                  {{ item.created_at }}
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">商品名称：</span>
                  {{ item.goods_name }}
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">商品编码：</span>
                  {{ item.goods_sku }}
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">供应商：</span>
                  <span v-if="expandcollapse.includes(index)">{{ item.supplier_name }}</span>
                  <el-button
                    v-if="!expandcollapse.includes(index)"
                    @click="chaxun(item,index)"
                    style="margin-left: 10px;"
                    type="text"
                  >查询</el-button>
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">购买号码：</span>
                  {{ item.plan_mobile }}
                </div>-->

                <!-- <div
                  style="font-size: 0.3rem; border-top: 1px #eaeaea solid; padding-top: 0.2rem; margin-bottom: 0.2rem;"
                >订单信息</div>
                <div>
                  <span class="t_table_list_con_title">证件姓名：</span>
                  {{ item.id_card_name }}
                  <span
                    class="t_table_list_con_title"
                    style="margin-left: 20px;"
                  >收件人：</span>
                  {{ item.address_name }}
                </div>
                <div>
                  <span class="t_table_list_con_title">证件号码：</span>
                  {{ item.id_card_num }}
                  <el-button @click="checkimg(item)" style="margin-left: 10px;" type="text">查看证件</el-button>
                  <el-button @click="jiemi(item,1)" type="text">查看完整信息</el-button>
                </div>
                <div>
                  <div style="margin-bottom: 0.2rem;">
                    <span class="t_table_list_con_title">联系电话：</span>
                    {{ item.address_mobile }}
                  </div>
                </div>
                <div>
                  <div class="t_item_info">
                    <span class="t_table_list_con_title">收货地址：</span>
                    {{ item.address_province }}{{ item.address_city }}{{ item.address_district }}{{ item.address }}
                  </div>
                </div>
                <div
                  style="font-size: 0.3rem; border-top: 1px #eaeaea solid; padding-top: 0.2rem; margin-bottom: 0.2rem;"
                >失败原因</div>
                <div style=" margin-bottom: 0.2rem;">{{ item.reason }}</div>
                <div
                  style="font-size: 0.3rem; border-top: 1px #eaeaea solid; padding-top: 0.2rem; margin-bottom: 0.2rem;"
                >订单状态</div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">订单状态：</span>
                  {{ item.status_name }}
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">交易状态：</span>
                  {{ item.pay_name }}
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">激活状态：</span>
                  {{ item.active_name }}
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <div class="t_item_info" v-if="item.active_name=='激活且充值'">
                    <span class="t_table_list_con_title">金额：</span>
                    {{ item.recharge_amount }}
                  </div>
                </div>

                <div
                  style="font-size: 0.3rem; border-top: 1px #eaeaea solid; padding-top: 0.2rem; margin-bottom: 0.2rem;"
                >生产信息</div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">生产号码：</span>
                  {{ item.plan_mobile_produce }}
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">物流公司：</span>
                  <span style="color: #409EFF;" @click="wuliu(item)">{{ item.tracking_company_id }}</span>
                </div>
                <div style=" margin-bottom: 0.2rem;">
                  <span class="t_table_list_con_title">物流单号：</span>
                  {{ item.tracking_number }}
                </div>
                <div
                  style="font-size: 0.3rem; border-top: 1px #eaeaea solid; padding-top: 0.2rem; margin-bottom: 0.2rem;"
                >备注</div>
                <div style=" margin-bottom: 0.2rem;">
                  <span v-html="item.remarks"></span>
                </div>
                <div
                  style="font-size: 0.3rem; border-top: 1px #eaeaea solid; padding-top: 0.2rem; margin-bottom: 0.2rem;"
                >操作</div>-->
                <!-- <div class="flexc">
                  <div v-if="nowtab==4">
                    <div
                      @click="agreetui(item,index)"
                      style="color: #409EFF; margin-right: 20px; font-size: 14px;"
                      v-if="item.pay_status==5&&!item.isclicktui"
                    >同意退款</div>
                    <div
                      v-if="item.isclicktui"
                      style="color: black; margin-right: 20px; font-size: 14px;"
                    >已退款</div>
                  </div>
                  <div v-else>
                    <div
                      @click="editorderbtn(item)"
                      style="color: #409EFF; margin-right: 20px; font-size: 14px;"
                    >修改订单</div>
                    <div
                      v-if="item.status==150||item.status==-460"
                      @click="giveup(item.order_id)"
                      style="color: #409EFF; margin-right: 20px;  font-size: 14px;"
                    >放弃订单</div>

                    <el-dropdown
                      @command="handleCommand($event,item)"
                      style="margin-left: 0; margin-top: 0;"
                      trigger="click"
                    >
                      <span class="el-dropdown-link">
                        更多操作
                        <i class="el-icon-arrow-down el-icon--right"></i>
                      </span>
                      <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item command="a">修改商品</el-dropdown-item>
                        <el-dropdown-item command="b">修改照片</el-dropdown-item>
                        <el-dropdown-item command="c">重提订单</el-dropdown-item>
                        <el-dropdown-item command="d">编辑备注</el-dropdown-item>
                        <el-dropdown-item command="e">退款</el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                  </div>
                </div>-->
              </div>
            </div>
          </van-list>
        </div>
      </div>
      <fenxiaoshangdingdan v-if="activeName ==='two'" />
      <div class="footer_tabs">
        <footerApp />
      </div>
    </div>
    <!-- 时间检索 -->
    <van-popup
      v-model="timeModal"
      round
      position="bottom"
      v-if="shoujiban"
      :style="{ height: '50%',padding:'20px 20px', }"
    >
      <div>
        <div style="font-size:16px;text-align:center">时间筛选</div>
        <img
          src="../../../static/appimg/close.png"
          alt
          @click="timeModal = false"
          style="width:10.67px;height:10.67px;position:absolute;right:15px;top:25px"
        />
      </div>
      <van-calendar v-model="c5show" type="range" :min-date="minDate" @confirm="c5ok" />
      <!-- 下单时间 -->
      <div style="font-size:14px;margin:10px 0">下单时间</div>
      <div class="flexc" style="font-size:12px">
        <div
          class="flexcc"
          style="flex: 1; background: #F6F8FB; padding: 0.2rem 0; border-radius: 10px;border: 1px solid rgb(227, 232, 241);"
          @click="c5show = true"
        >
          <div style="color: rgb(175, 179, 188); margin-right: 0.2rem;">{{ c5name }}</div>
          <div>
            <img src="../../../static/appimg/arrowtwo.png" style="width:8px;height:6px" />
          </div>
        </div>
        <div style="margin: 0 0.2rem;">~</div>
        <div
          class="flexcc"
          style="flex: 1; background: #F6F8FB; padding: 0.2rem 0; border-radius: 10px;border: 1px solid rgb(227, 232, 241);"
          @click="c5show = true"
        >
          <div style="color: rgb(175, 179, 188); margin-right: 0.2rem;">{{ c6name }}</div>
          <div>
            <img src="../../../static/appimg/arrowtwo.png" style="width:8px;height:6px" />
          </div>
        </div>
      </div>
      <!-- 激活时间 -->
      <van-calendar v-model="c5shows" type="range" :min-date="minDate" @confirm="c5oks" />
      <div style="font-size:14px;margin:10px 0">激活时间</div>
      <div class="flexc" style="font-size:12px">
        <div
          class="flexcc"
          style="flex: 1; background: #F6F8FB; padding: 0.2rem 0; border-radius: 10px;border: 1px solid rgb(227, 232, 241);"
          @click="c5shows = true"
        >
          <div style="color: rgb(175, 179, 188); margin-right: 0.2rem;">{{ c5names }}</div>
          <div>
            <img src="../../../static/appimg/arrowtwo.png" style="width:8px;height:6px" />
          </div>
        </div>
        <div style="margin: 0 0.2rem;">~</div>
        <div
          class="flexcc"
          style="flex: 1; background: #F6F8FB; padding: 0.2rem 0; border-radius: 10px;border: 1px solid rgb(227, 232, 241);"
          @click="c5shows = true"
        >
          <div style="color: rgb(175, 179, 188); margin-right: 0.2rem;">{{ c6names }}</div>
          <div>
            <img src="../../../static/appimg/arrowtwo.png" style="width:8px;height:6px" />
          </div>
        </div>
      </div>
      <div class="reset_ok_container">
        <div class="reset_type" @click="resetClick">重置</div>
        <div class="ok_type" @click="okClick">确定</div>
      </div>
    </van-popup>
    <!-- 交易状态检索 -->
    <van-popup v-model="c8show" round position="bottom" v-if="shoujiban">
      <van-picker
        show-toolbar
        :columns="[
          { key: '1', value: '已支付' },
          { key: '5', value: '退款中' },
          { key: '6', value: '退款成功' },
          { key: '10', value: '无需支付' }
        ]"
        value-key="value"
        @cancel="c8show = false"
        @confirm="c8ok"
      ></van-picker>
    </van-popup>
    <!-- 激活状态检索 -->
    <van-popup
      v-model="activeModal"
      v-if="shoujiban"
      position="bottom"
      :style="{ height: '25%',borderRadius:'20px 20px 0 0',padding:'20px 20px', }"
    >
      <div class="select_container_outer">
        <div
          class="select_container"
          :style="{color:isActive==1?'#2757FF':'#787D85'}"
          @click="isActiveClick(1);"
        >未激活</div>
        <div
          class="select_container"
          :style="{color:isActive==2?'#2757FF':'#787D85'}"
          @click="isActiveClick(2);"
        >已激活</div>
        <div
          class="select_container"
          :style="{color:isActive==3?'#2757FF':'#787D85'}"
          @click="isActiveClick(3);"
        >激活且充值</div>
      </div>
    </van-popup>
    <!-- 状态检索 -->
    <van-popup
      v-model="orderModal"
      v-if="shoujiban"
      position="bottom"
      :style="{ height: '30%',borderRadius:'20px 20px 0 0',padding:'20px 20px', }"
    >
      <div class="select_container_outer">
        <div
          class="select_container"
          :style="{color:isOrder==1?'#2757FF':'#787D85'}"
          @click="isOrderClick(1);"
        >订单关闭</div>
        <div
          class="select_container"
          :style="{color:isOrder==2?'#2757FF':'#787D85'}"
          @click="isOrderClick(2);"
        >订单冻结</div>
        <div
          class="select_container"
          :style="{color:isOrder==3?'#2757FF':'#787D85'}"
          @click="isOrderClick(3);"
        >待开卡</div>
        <div
          class="select_container"
          :style="{color:isOrder==4?'#2757FF':'#787D85'}"
          @click="isOrderClick(4);"
        >已提单</div>
        <div
          class="select_container"
          :style="{color:isOrder==5?'#2757FF':'#787D85'}"
          @click="isOrderClick(5);"
        >开卡中(已领)</div>
        <div
          class="select_container"
          :style="{color:isOrder==6?'#2757FF':'#787D85'}"
          @click="isOrderClick(6);"
        >待发货</div>
        <div
          class="select_container"
          :style="{color:isOrder==7?'#2757FF':'#787D85'}"
          @click="isOrderClick(7);"
        >已发货</div>
        <div
          class="select_container"
          :style="{color:isOrder==8?'#2757FF':'#787D85'}"
          @click="isOrderClick(8);"
        >生产失败</div>
        <div
          class="select_container"
          :style="{color:isOrder==9?'#2757FF':'#787D85'}"
          @click="isOrderClick(9);"
        >证件不合格</div>
      </div>
    </van-popup>
    <el-dialog
      :close-on-click-modal="false"
      :modal-append-to-body="false"
      :close-on-press-escape="false"
      title="提示"
      :visible.sync="isshowlian"
      width="300px"
    >
      <span>订单已发货，请联系管理员退款</span>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="mini" @click="isshowlian = false">确 定</el-button>
      </span>
    </el-dialog>

    <el-dialog
      :close-on-click-modal="false"
      :modal-append-to-body="false"
      :close-on-press-escape="false"
      title="操作记录"
      :visible.sync="logjilu"
      width="600px"
    >
      <div class="flexc" style="margin-bottom: 20px;" v-for="(item,index) in jiluall" :key="index">
        <div class="flexc">
          <div style="margin-right: 20px; color: #409EFF;">{{item.created_at}}</div>
          <div>{{item.content}}</div>
        </div>
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="mini" @click="logjilu = false">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      :close-on-click-modal="false"
      :modal-append-to-body="false"
      :close-on-press-escape="false"
      title="多个订单ID搜索"
      :visible.sync="ordersVisible"
      width="600px"
    >
      <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="search.order_nos" />
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="mini" @click="searchClick">搜索</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { bufahuodiqu } from "../../assets/bufahuodiqu.js";
import { tongyidizhi } from "../../common/tongyidiqu.js";
import QRCode from "qrcodejs2";
import left from "../left.vue";
import footerApp from "../footerApp.vue";
import fenxiaoshangdingdan from "./fenxiaoshangdingdan.vue";
import top from "../top.vue";
import footers from "../footer.vue";
import chuantu2 from "@/components/chuantu2.vue";
import topandleft from "../topandleft.vue";
import fuwenben from "@/components/fuwenbenclear.vue";
import { regionData, CodeToText, TextToCode } from "element-china-area-data";
export default {
  name: "dingdanchuli",
  components: {
    left,
    top,
    chuantu2,
    topandleft,
    footerApp,
    footers,
    fuwenben,
    fenxiaoshangdingdan
  },
  data() {
    return {
      c5shows: false,
      c5names: "激活开始时间",
      c6shows: false,
      c6names: "激活结束时间",
      c5show: false,
      c5name: "开始时间",
      c6show: false,
      c6name: "结束时间",
      c8name: "交易状态",
      c8show: false,
      timeModal: false,
      isActive: 0,
      isOrder: 0,
      orderModal: false,
      activeModal: false,
      activeName: "one",
      ordersVisible: false,
      auto_circulation: 0, //自动流转
      nowtab: 1,
      list: [],
      total: 0,
      search: {
        quick_return:"",
        order_nos:'',
        page: 1,
        page_size: 20,
        source: "",
        status: "",
        goods_name: "",
        goods_sku: "",
        active_status: "",
        order_no: "",
        id_card_num: "",
        address_mobile: "",
        plan_mobile_produce: "",
        tracking_number: "",
        start_time: "",
        end_time: "",
        sort: "desc", //排序  asc  升序 desc 降序
        sort_key: "created_at",
        pay_status: "",
        active_start_time: "",
        active_end_time: "",
        settlement_conditions: "",
        all_round: ""
      },
      isshoweditseller: false,
      goods_name: "",
      goods_sku: "",
      skucheckres: "",
      disablename: false,
      disablesku: false,
      isshoweditimg: false,
      checkimgitem: {},
      activeoptions: [],
      orderoptions: [],
      selleroptions: [],
      isshoweditorder: false,
      // options: regionData,//原地址
      // options: tongyidizhi,//统一地址
      options: bufahuodiqu,
      localcitycode: "",
      changeorderinfo: {
        address_name: "",
        id_card_name: "",
        id_card_num: "",
        address_mobile: "",
        address: "",
        address_province: "",
        address_city: "",
        address_district: "",
        order_id: "",
        is_submit: ""
      },
      province_z: "",
      city_z: "",
      district_z: "",
      card_img_1: "",
      card_img_2: "",
      card_img_3: "",
      checkimgtype: null,
      isshowzdyshq: false,
      spid: "",
      wuliuxiangqingall: "",
      wuliuxiangqinglog: false,
      shoujiban: false,
      loading: false,
      finished: false,
      showdate: false,
      whodata: "",
      minDate: new Date(2023, 0, 1),
      selectDate: "",
      pickerOptions: {
        onPick: ({ maxDate, minDate }) => {
          this.selectDate = minDate.getTime();
          if (maxDate) {
            this.selectDate = "";
          }
        },
        disabledDate: time => {
          if (this.selectDate !== "") {
            const one = 62 * 24 * 3600 * 1000;
            const minTime = this.selectDate - one;
            const maxTime = this.selectDate + one;
            return time.getTime() < minTime || time.getTime() > maxTime;
          }
        }
      },
      times: [],
      times2: [],
      now: "",
      beizhulog: false,
      relo: true,
      card_num: 0,
      fail_num: 0,
      refund_num: 0,
      isshowlian: false,
      gongyingshang: "", //供应商
      expandcollapse: [],
      flag: "",
      logjilu: false,
      jiluall: "",
      auto_order_cancel:0
    };
  },
  created() {
    console.log(regionData);
    //列表
    // this.getlist()
    //商品列表
    this.getshoplist();
    //激活状态
    this.getactivelist();
    //订单状态
    this.getorderactive();
    this.getzidongliuzhuan();
    this.getzidongliuzhuan2();
  },
  mounted() {
    if (window.screen.width < 1080) {
      this.shoujiban = true;
      var h = document.documentElement.clientWidth / 7.5 + "px";
      document.documentElement.style.fontSize = h;

      // this.onLoad()
    } else {
      this.getlist();
    }
  },
  methods: {
    bianjixiangqing(item) {
      // const isclicktui=item.isclicktui?"1":"0"
      this.$router.push(
        "/dingdanguanli/orderList?id=" + item.order_id
        // "/dingdanguanli/orderList?id="+item.order_id+"&nowtab="+this.nowtab+"&pay_status="+item.pay_status+"&isclicktui="+isclicktui+"&status="+item.status
      );
    },
    settingClick() {
      window.location.href = "./setting";
    },
    okClick() {
      this.timeModal = false;
    },
    resetClick() {
      this.c5name = "开始时间";
      this.c6name = "结束时间";
      this.c5names = "激活开始时间";
      this.c6names = "激活结束时间";
    },
    timeClick() {
      this.timeModal = true;
    },
    isActiveClick(val) {
      this.isActive = val;
      if (this.isActive == 2) {
        this.search.active_status = 100;
      } else if (this.isActive == 1) {
        this.search.active_status = 0;
      } else if (this.isActive == 3) {
        this.search.active_status = 200;
      }
      // this.getlist();
      this.activeModal = false;
      this.search.page = 1;
      this.search.order_nos = this.search.order_nos.split(/\n/).join(",");
      if (window.screen.width < 1080) {
        this.list = [];
        this.loading = false;
        this.finished = false;
        this.onLoad();
      } else {
        this.getlist();
      }
    },
    activeStatuClick() {
      this.activeModal = true;
    },
    isOrderClick(val) {
      this.isOrder = val;
      if (this.isOrder == 1) {
        this.search.status = 0;
      } else if (this.isOrder == 2) {
        this.search.status = 400;
      } else if (this.isOrder == 3) {
        this.search.status = 450;
      } else if (this.isOrder == 4) {
        this.search.status = 460;
      } else if (this.isOrder == 5) {
        this.search.status = 470;
      } else if (this.isOrder == 6) {
        this.search.status = 500;
      } else if (this.isOrder == 7) {
        this.search.status = 550;
      } else if (this.isOrder == 8) {
        this.search.status = -460;
      } else if (this.isOrder == 9) {
        this.search.status = -200;
      }
      this.orderModal = false;
      this.getlist();
    },
    orderStatuClick() {
      this.orderModal = true;
    },
    c8ok: function(v, i) {
      console.log(v);
      console.log(i);
      this.c8name = v.value.slice(0, 4);
      this.search.pay_status = v.key;
      this.searchbtn();
      this.c8show = false;
    },
    c5ok: function(v, i) {
      this.search.start_time = moment(v[0]).format("YYYY-MM-DD");
      this.search.end_time = moment(v[1]).format("YYYY-MM-DD");
      this.c5name = moment(v[0]).format("YYYY-MM-DD");
      this.c6name = moment(v[1]).format("YYYY-MM-DD");
      this.searchbtn();
      this.c5show = false;
    },
    c5oks: function(v, i) {
      this.search.active_start_time = moment(v[0]).format("YYYY-MM-DD");
      this.search.active_end_time = moment(v[1]).format("YYYY-MM-DD");
      this.c5names = moment(v[0]).format("YYYY-MM-DD");
      this.c6names = moment(v[1]).format("YYYY-MM-DD");
      this.searchbtn();
      this.c5shows = false;
    },
    choosetab: function(val) {
      this.activeName = val;
    },

    async searchClick() {
      await this.searchbtn();
      this.ordersVisible = false;
    },
    addorder() {
      this.ordersVisible = true;
    },
    //自动流转
    getzidongliuzhuan: function() {
      axios.get("/own/page/system/get").then(response => {
        if (response.data.msg.code == 0) {
          this.auto_circulation = response.data.data.auto_circulation;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    zidongliuzhuan: function() {
      axios
        .post("/own/page/system/config", {
          auto_circulation: this.auto_circulation
        })
        .then(response => {
          if (response.data.msg.code == 0) {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    //自动流转
    getzidongliuzhuan2: function() {
      axios.get("/own/system/get").then(response => {
        if (response.data.msg.code == 0) {
          this.auto_order_cancel = response.data.data.auto_order_cancel;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    zidongliuzhuan2: function() {
      axios
        .post("/own/system/config", {
          auto_order_cancel: this.auto_order_cancel
        })
        .then(response => {
          if (response.data.msg.code == 0) {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    //自动流转
    caozuojilu: function(item) {
      axios
        .get("/own/order/record?order_id=" + item.order_id)
        .then(response => {
          if (response.data.msg.code == 0) {
            this.jiluall = response.data.data;
            this.logjilu = true;
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    getcontent: function(item) {
      this.now.remarks = item;
      const fonts = document.getElementsByTagName('font');
      for (let font of fonts) {
          const face = font.getAttribute('face');
          if (face) {
              font.style.setProperty('font-family', `"${face}"`, 'important');
              console.log(`修复字体: ${face}`);
          }
      }
    },
    baocunbeizhu: function() {
      axios
        .post("/own/order/remakes/update", {
          order_id: this.now.order_id,
          remarks: this.now.remarks
        })
        .then(response => {
          if (response.data.msg.code == 0) {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.getlist();
            this.beizhulog = false;
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    daochu: function() {
      axios
        .get("/own/my/order/export", { params: this.search })
        .then(response => {
          if (response.data.msg.code == 0) {
            location.href = response.data.data;
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    timechange2: function(val) {
      if (this.times2 == null) {
        this.search.active_start_time = "";
        this.search.active_end_time = "";
      } else {
        this.search.active_start_time = this.times2[0];
        this.search.active_end_time = this.times2[1];
      }
    },
    timechange: function(val) {
      if (this.times == null) {
        this.search.start_time = "";
        this.search.end_time = "";
      } else {
        this.search.start_time = this.times[0];
        this.search.end_time = this.times[1];
      }
    },
    xuanshijianshow: function(val) {
      if (val == 1) {
        this.showdate = true;
        this.whodata = "start_time";
      }
      if (val == 2) {
        this.showdate = true;
        this.whodata = "end_time";
      }
    },
    xuanshijian: function(val) {
      this.search[this.whodata] = moment(val).format("YYYY-MM-DD hh:mm:ss");
      this.showdate = false;
    },
    onLoad() {
      this.finished = true;
      axios.get("/own/my/order", { params: this.search }).then(response => {
        if (response.data.msg.code == 0) {
          if (response.data.data.data.length > 0) {
            response.data.data.data.forEach(item => {
              this.list.push(item);
            });

            if (this.list.length >= response.data.data.total) {
              this.finished = true;
            } else {
              this.search.page++;
              this.loading = false;
              this.finished = false;
            }

          } else {
            this.finished = true;
          }
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    wuliu: function(item) {
      axios
        .post("/api/order/track/query", { order_id: item.order_no })
        .then(response => {
          if (response.data.msg.code == 0) {
            this.wuliuxiangqingall = response.data.data;
            if (this.wuliuxiangqingall && this.wuliuxiangqingall.Traces) {
              this.wuliuxiangqingall.Traces = this.wuliuxiangqingall.Traces.reverse();
            }
            this.wuliuxiangqinglog = true;
          } else {
            if (response.data.msg.code == 444) {
            } else {
              this.$message.error(response.data.msg.info);
            }
          }
        });
    },
    //列表
    getlist() {
      axios.get("/own/my/order", { params: this.search }).then(response => {
        if (response.data.msg.code == 0) {
          console.log("列表");
          console.log(response.data.data);
          this.list = response.data.data.data;
          console.log("this.list233333333", this.list);
          this.total = response.data.data.total;
          this.card_num = response.data.data.card_num;
          this.fail_num = response.data.data.fail_num;
          this.refund_num = response.data.data.refund_num;
          this.expandcollapse = [];
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //商品列表
    getshoplist() {
      axios.get("/own/page/list?is_all=1").then(response => {
        console.log("999", response);
        if (response.data.msg.code == 0) {
          console.log("商品列表");
          console.log("8888", response.data.data.data);
          this.selleroptions = response.data.data.data;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //激活状态
    getactivelist() {
      axios.get("/api/order/active_status/list").then(response => {
        if (response.data.msg.code == 0) {
          var arr = [];
          for (let index in response.data.data) {
            // console.log(index)//key
            // console.log(obj[index])//value
            arr.push({ key: index, value: response.data.data[index] });
          }
          this.activeoptions = arr;
          console.log("激活状态");
          console.log(arr);
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //订单状态
    getorderactive() {
      axios.get("/api/order/status/list").then(response => {
        if (response.data.msg.code == 0) {
          var arr = [];
          for (let index in response.data.data) {
            // console.log(index)//key
            // console.log(obj[index])//value
            arr.push({ key: index, value: response.data.data[index] });
          }
          this.orderoptions = arr;
          console.log("订单状态");
          console.log(arr);
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //切换tab
    choosetabbtn(i) {
      this.nowtab = i;
      this.search.page = 1;
      if (i == 1) {
        this.search.status = "";
        this.search.pay_status = "";
      }
      if (i == 2) {
        this.search.status = "-200";
        this.search.pay_status = "";
      }
      if (i == 3) {
        this.search.status = "-460";
        this.search.pay_status = "";
      }
      if (i == 4) {
        this.search.status = "";
        this.search.pay_status = "5";
      }

      if (window.screen.width < 1080) {
        this.list = [];
        this.loading = false;
        this.finished = false;
        this.onLoad();
      } else {
        this.getlist();
      }
    },
    //切换排序
    changesort() {
      if (this.search.sort == "asc") {
        this.search.sort = "desc";
        this.getlist();
        return;
      }
      if (this.search.sort == "desc") {
        this.search.sort = "asc";
        this.getlist();
        return;
      }
    },
    //搜索
    searchbtn() {
      this.search.page = 1;
      this.search.order_nos = this.search.order_nos.split(/\n/).join(",");

      if (window.screen.width < 1080) {
        this.list = [];
        this.loading = false;
        this.finished = false;
        this.onLoad();
      } else {
        this.getlist();
      }
    },
    //重置
    resetbtn() {
      this.search.page = 1;
      this.search.source = "";
      this.search.status = "";
      this.search.goods_sku = "";
      this.search.goods_name = "";
      this.search.active_status = "";
      this.search.order_no = "";
      this.search.id_card_num = "";
      this.search.address_mobile = "";
      this.search.plan_mobile_produce = "";
      this.search.tracking_number = "";
      this.search.start_time = "";
      this.search.end_time = "";
      this.search.sort = "asc";
      this.search.pay_status = "";
    },
    //分页
    pagechange(val) {
      console.log(val);
      this.search.page = val;
      //列表
      this.getlist();
    },
    //复制功能
    // copy: function(text) {
    //   var textArea = document.createElement('textarea');
    //   textArea.value = text;
    //   document.body.appendChild(textArea);
    //   textArea.select();
    //   try {
    //       var successful = document.execCommand('copy');
    //       this.$toast.success('复制链接成功');
    //   } catch (err) {
    //       this.$toast.success('复制链接失败');
    //   }
    //   document.body.removeChild(textArea);
    // },
    //放弃订单
    giveup(order_id) {
      this.$confirm("是否确认放弃订单?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          axios
            .post("/own/order/status/set", {
              order_id: order_id,
              status: 0
            })
            .then(response => {
              if (response.data.msg.code == 0) {
                this.$message({
                  type: "success",
                  message: "操作成功!"
                });
                this.getlist();
              } else {
                this.$message.error(response.data.msg.info);
              }
            });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消"
          });
        });
    },
    handleCommand(command, item) {
      if (command == "c") {
        //重提订单
        this.$confirm("是否确认重提订单?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            axios
              .post("/own/order/submit", {
                id: item.order_id
              })
              .then(response => {
                if (response.data.msg.code == 0) {
                  this.$message({
                    type: "success",
                    message: "操作成功!"
                  });

                  this.getlist();
                } else {
                  this.$message.error(response.data.msg.info);
                }
              });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
          });
      }
      if (command == "a") {
        //修改商品
        this.isshoweditseller = true;
        this.checkimgitem = item;
        this.goods_name = "";
        this.goods_sku = "";
        this.spid = "";
        this.disablename = false;
        this.disablesku = false;
        this.skucheckres = "";
      }
      if (command == "b") {
        //修改照片
        this.isshoweditimg = true;
        this.checkimgitem = item;
        this.card_img_1 = item.face_url;
        this.card_img_2 = item.back_url;
        this.card_img_3 = item.hand_url;
        this.checkimgtype = 2;

        this.relo = false;
        this.$nextTick(() => {
          this.relo = true;
        });
      }
      if (command == "d") {
        //备注
        this.now = {
          order_id: item.order_id,
          remarks: item.remarks
        };

        this.beizhulog = true;
        this.relo = false;
        this.$nextTick(() => {
          this.relo = true;
        });
      }
      if (command == "e") {
        //是否主动给用户退款？
        this.$confirm("是否主动给用户退款？", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            axios
              .post("/own/order/refund", {
                order_id: item.order_id
              })
              .then(response => {
                if (response.data.msg.code == 0) {
                  this.$message({
                    type: "success",
                    message: "操作成功!"
                  });

                  this.getlist();
                } else {
                  this.$message.error(response.data.msg.info);
                }
              });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
          });
      }
    },

    //打开修改订单
    editorderbtn(item) {
      this.jiemi(item, 2);

      this.changeorderinfo.order_id = item.order_id;
      this.isshoweditorder = true;

      this.changeorderinfo.address_province = item.province;
      this.changeorderinfo.address_city = item.city;
      this.changeorderinfo.address_district = item.district;

      this.localcitycode = [
        item.address_province,
        item.address_city,
        item.address_district
      ];
      console.log(this.localcitycode);
      this.changeTextToCode(
        item.address_province,
        item.address_city,
        item.address_district
      );
    },
    //地区文字转编码
    changeTextToCode(province, city, district) {
      var citycode = [];
      try {
        if (province != "") {
          citycode.push(TextToCode[province].code);
        }
        if (city != "") {
          citycode.push(TextToCode[province][city].code);
        }
        if (district != "") {
          citycode.push(TextToCode[province][city][district].code);
        }
        this.localcitycode = citycode;
        this.isshowzdyshq = false;
      } catch (e) {
        //手动
        console.log("没有在组件库找到此地址");
        this.isshowzdyshq = true;
        this.province_z = province;
        this.city_z = city;
        this.district_z = district;
      }

      this.changeorderinfo.address_province = province;
      this.changeorderinfo.address_city = city;
      this.changeorderinfo.address_district = district;
    },
    //选择地址
    changeaddress(val) {
      console.log(val);
      this.province_z = "";
      this.city_z = "";
      this.district_z = "";
      this.changeorderinfo.address_province = this.changeCodeToText(val[0]);
      this.changeorderinfo.address_city = this.changeCodeToText(val[1]);
      this.changeorderinfo.address_district = this.changeCodeToText(val[2]);
    },
    //手动输入地址
    inputaddress() {
      this.localcitycode = [];
      this.changeorderinfo.address_province = this.province_z;
      this.changeorderinfo.address_city = this.city_z;
      this.changeorderinfo.address_district = this.district_z;
    },
    //地区编码转文字
    changeCodeToText(code) {
      return CodeToText[code];
    },
    //修改订单
    upeditorder(type) {
      this.changeorderinfo.is_submit = type;
      console.log(this.changeorderinfo);
      axios.post("/own/order/info/set", this.changeorderinfo).then(response => {
        if (response.data.msg.code == 0) {
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.isshoweditorder = false;
          this.getlist();
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //修改照片
    upediteimg(val) {
      let is_submit = "";
      if (val == 1) {
        is_submit = 1;
      }
      axios
        .post("/own/order/picture/set", {
          face_url: this.card_img_1,
          back_url: this.card_img_2,
          hand_url: this.card_img_3,
          custom_photos_url:this.checkimgitem.custom_photos_url,
          order_id: this.checkimgitem.order_id,
          is_submit: is_submit
        })
        .then(response => {
          if (response.data.msg.code == 0) {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.isshoweditorder = false;
            this.getlist();
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
      this.isshoweditimg = false;
    },
    //查看照片
    checkimg(item) {
      this.checkimgitem = item;
      this.card_img_1 = item.face_url;
      this.card_img_2 = item.back_url;
      this.card_img_3 = item.hand_url;
      this.isshoweditimg = true;
      this.checkimgtype = 1;
    },
    //监听修改名称
    checkchengname() {
      console.log(this.goods_name);
      if (this.goods_name != "") {
        this.disablesku = true;
        this.spid = "";
      } else {
        this.disablesku = false;
      }
    },
    //监听修改编码
    checkchengsku() {
      if (this.goods_sku != "") {
        this.disablename = true;
      } else {
        this.disablename = false;
        this.skucheckres = "";
        this.spid = "";
      }
    },
    //查看编码
    checkskures() {
      if (this.goods_sku != "") {
        axios
          .get("/own/page/list", { params: { fetch_code: this.goods_sku } })
          .then(response => {
            if (response.data.msg.code == 0) {
              console.log("查询商品列表");
              console.log(response);
              if (response.data.data.data.length == 0) {
                this.skucheckres = "未查询到结果";
                this.spid = "";
              } else {
                this.skucheckres =
                  "商品名：" + response.data.data.data[0].title;
                this.spid = response.data.data.data[0].id;
              }
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      }
    },
    //修改商品
    upeditseller() {
      if (this.goods_name == "" && this.goods_sku == "") {
        this.$message.error("请输入正确信息");
        return;
      }
      if (this.skucheckres == "未查询到结果") {
        this.$message.error("请输入正确信息");
        return;
      }

      var goods_id = "";
      if (this.goods_name) {
        goods_id = this.goods_name;
      } else if (this.spid) {
        goods_id = this.spid;
      }

      axios
        .post("/own/order/goods/set", {
          goods_id: goods_id,
          id: this.checkimgitem.order_id
        })
        .then(response => {
          if (response.data.msg.code == 0) {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.isshoweditseller = false;
            this.getlist();
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    //监听返回方法
    getimg1(item) {
      this.card_img_1 = item;
      console.log(item);
    },
    getimg2(item) {
      this.card_img_2 = item;
      console.log(item);
    },
    getimg3(item) {
      this.card_img_3 = item;
      console.log(item);
    },
    getimg4(item) {
      this.checkimgitem.custom_photos_url = item;
      console.log(item);
    },

    //解密
    jiemi(item, type) {
      axios
        .post("/own/order/info/decrypt", { order_id: item.order_id })
        .then(response => {
          if (response.data.msg.code == 0) {
            console.log("解密");
            console.log(response);
            if (type == 1) {
              //列表
              this.$set(item, "id_card_name", response.data.data.id_card_name);
              this.$set(item, "id_card_num", response.data.data.id_card_num);
              this.$set(item, "address_name", response.data.data.address_name);
              this.$set(
                item,
                "address_mobile",
                response.data.data.address_mobile
              );
              this.$set(item, "address", response.data.data.address);
            }
            if (type == 2) {
              //修改
              this.changeorderinfo.address_name =
                response.data.data.address_name;
              this.changeorderinfo.id_card_name =
                response.data.data.id_card_name;
              this.changeorderinfo.id_card_num = response.data.data.id_card_num;
              this.changeorderinfo.address_mobile =
                response.data.data.address_mobile;
              this.changeorderinfo.address = response.data.data.address;
            }
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    //显示自定义省市区
    showzdy() {
      this.isshowzdyshq = true;
    },
    agreetui2(item, index) {

      this.$prompt('是否确认拒绝退款', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消'
      }).then(({ value }) => {
        axios
          .post("/own/order/refund", {
            order_id: item.order_id,
            refuse:1,
            refuse_remarks:value
          })
          .then(response => {
            if (response.data.msg.code == 0) {
              this.$message({
                type: "success",
                message: "操作成功!"
              });

              var newitem = item;
              item.isclicktui = 3;
              this.$set(this.list, index, newitem);

              // this.getlist()
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      })
    },
    //同意退款
    agreetui(item, index) {
      // if(item.status==550){
      //   this.isshowlian = true
      // }else{
      this.$confirm("是否确认退款?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          axios
            .post("/own/order/refund", {
              order_id: item.order_id
            })
            .then(response => {
              if (response.data.msg.code == 0) {
                this.$message({
                  type: "success",
                  message: "操作成功!"
                });

                var newitem = item;
                item.isclicktui = 1;
                this.$set(this.list, index, newitem);

                // this.getlist()
              } else {
                this.$message.error(response.data.msg.info);
              }
            });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消"
          });
        });
      // }
    },
    chaxun(item, index) {
      // console.log('item,index',item,index)
      //第一次点击
      if (!this.expandcollapse.includes(index)) {
        this.expandcollapse.push(index);
      } else {
        this.expandcollapse = this.expandcollapse.filter(item => {
          return item !== index;
        });
      }
    },
    suffixClick() {
      console.log("xsuffixClick");
    }
  }
};
</script>

<style scoped>
/deep/ .el-input__suffix {
  line-height: 41px;
}
/deep/.t_table_list_con .el-button {
  padding-top: 0;
  padding-bottom: 0;
}
/deep/.t_table_list_con .el-dropdown {
  margin-top: 0 !important;
}
/* /deep/.t_del_com .el-input__inner{
		border: none !important;
		background-color: white !important;
	} */
.t_list_tab_box {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  align-items: center;
}
.t_choose_tab_box {
  display: flex;
}
.t_tab_title {
  color: #020c1d;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.t_tab_title_lei {
  color: #005aff;
}
.t_under_line {
  width: 30px;
  height: 2px;
  background-color: #f6f8fb;
  margin-top: 10px;
}
.t_under_line_app {
  width: 18px;
  height: 3px;
  background-color: #f6f8fb;
  margin-top: 6px;
  border-radius: 25px;
}
.t_under_line_lei {
  background-color: #005aff;
}
.t_table_header_box {
  height: 60px;
  background-color: white;
  border-radius: 20px;
  display: flex;
  padding: 0 30px;
  align-items: center;
}
.t_table_header_box div {
  font-size: 14px;
  color: #404247;
}
.t_table_list_con {
  background-color: white;
  border-radius: 20px;
  margin-top: 10px;
  margin-bottom: 10px;
}
.t_tab_w1 {
  width: 12%;
}
.t_tab_w2 {
  width: 13%;
}
.t_tab_w3 {
  width: 25%;
}
.t_tab_w4 {
  width: 17%;
}
.t_tab_w5 {
  width: 13%;
}
.t_tab_w6 {
  width: 15%;
}
.t_tab_w7 {
  width: 5%;
}
.t_table_list_top {
  display: flex;
  box-sizing: border-box;
  border-bottom: 1px solid #e3e8f1;
  padding: 20px 30px;
  font-size: 14px;
  color: #404247;
}
.t_table_list_con_con {
  font-size: 14px;
  box-sizing: border-box;
  padding: 20px 30px 0;
  display: flex;
}
.t_table_list_con_title {
  color: #787d85;
}
.t_item_info {
  margin-bottom: 20px;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
  font-weight: 500;
}

.el-icon-arrow-down {
  font-size: 12px;
}
.el-dropdown {
  margin-left: 10px;
  margin-top: 10px;
}
/deep/.el-textarea.is-disabled .el-textarea__inner {
  border-radius: 20px;
}
.t_change_seller_title {
  margin-bottom: 13px;
  font-size: 16px;
}
.t_photo_top {
  display: flex;
  justify-content: space-between;
}
.t_img_list_box {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  gap: 20px;
}
.t_img_box {
  flex:1;
  border-radius: 10px;
  overflow: hidden;
  background-color: #f6f8fb;
  position: relative;
  cursor: pointer;
}
.t_img_item {
  flex: 1;
  text-align: center;
}
.t_img_tips {
  color: #787d85;
  font-size: 16px;
  margin-top: 15px;
}
.t_add_img {
  color: #005aff;
  font-size: 34px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -17px;
  margin-top: -17px;
}
.t_check_old_img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
}
/deep/ .el-input__icon .el-icon-circle-plus {
  color: blue; /* 改变图标的颜色为蓝色 */
  font-size: 20px; /* 改变图标的大小 */
}
</style>
<style scoped lang="less">
.gongyingshangshangpin {
  .sxjact {
    background: rgb(0, 90, 255);
    border-radius: 30px;
    font-size: 24px;
    text-align: center;
    font-weight: 500;
    color: rgb(255, 255, 255);
    width: 150px;
    height: 60px;
    margin-right: 30px;
  }
  .sxj {
    background: rgb(227, 232, 241);
    border-radius: 30px;
    font-size: 24px;
    text-align: center;
    font-weight: 500;
    color: rgb(175, 179, 188);
    width: 150px;
    height: 60px;
    margin-right: 30px;
  }
  .xt {
    width: 72px;
    height: 26px;
    margin-right: 10px;
    border-radius: 5px;
    font-size: 12px;
  }
  .lj {
    width: 100px;
    height: 32px;
    color: rgb(64, 66, 71);
    background: rgb(227, 232, 241);
    border-radius: 16px;
    margin-right: 20px;
    font-size: 14px;
    cursor: pointer;
  }
  .ljact {
    width: 100px;
    height: 32px;
    color: rgb(0, 90, 255);
    background: rgb(228, 237, 255);
    border-radius: 16px;
    margin-right: 20px;
    font-size: 14px;
    cursor: pointer;
  }
  .bushi3 {
    margin-right: 20px;
  }
  .act {
    background: rgb(0, 90, 255) !important;
    color: #fff !important;
  }
}
/deep/ .el-input__icon .el-icon-circle-plus {
  color: blue; /* 改变图标的颜色为蓝色 */
  font-size: 20px; /* 改变图标的大小 */
}
:deep(.el-input__suffix) {
  line-height: 41px;
}
.footer_tabs {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
}
.tabs_container {
  display: flex;
  width: 100%;
  height: 44px;
  background: white;
  padding: 0 15px;
}
.wares {
  font-size: 19px;
  color: #020c1d;
  font-weight: bold;
  margin-top: 20px;
  font-family: "PingFang SC";
}
.initial {
  font-size: 16px;
  color: #afb3bc;
  margin-top: 20px;
}
.search_container {
  height: 98.5px;
  background: white;
  width: 100%;
  border-radius: 0 0 20px 20px;
  padding-right: 15px;
}
.search_input_container {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  padding-right: 3px;
  border: 1px solid #e3e8f1;
  border-radius: 25px;
  background: #f6f8fb;
}
/deep/ .search_input_container .search_input .el-input__inner {
  width: 290px;
  height: 32px !important;
  border: 0 !important;
}
.search_color {
  background: #2757ff;
  color: white;
  font-size: 14px;
  text-align: center;
  width: 50px;
  height: 30px;
  line-height: 30px;
  border-radius: 18.5px;
}
.tabs_footer_container {
  border-radius: 0 0 20px 20px;
  padding-top: 15px;
  padding-left: 25px;
  padding-right: 20px;
  color: #787d85;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.order_container {
  font-size: 13px !important;
  display: flex;
  align-items: center;
}
.select_container_outer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.select_container {
  width: 78px;
  height: 35px;
  line-height: 35px;
  text-align: center;
  background: #f6f8fb;
  border: 1px solid #e3e8f1;
  font-size: 12px;
  color: #787d85;
  border-radius: 5px;
}
.reset_ok_container {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
}
.reset_type {
  width: 165px;
  height: 40px;
  background: #afb3bc;
  font-size: 14px;
  color: black;
  text-align: center;
  line-height: 40px;
  border-radius: 25px;
}
.ok_type {
  width: 165px;
  height: 40px;
  background: #005aff;
  font-size: 14px;
  color: white;
  text-align: center;
  line-height: 40px;
  border-radius: 25px;
}
</style>
